package com.leyu.mall.service.goods.impl;

 
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.leyu.mall.common.facade.IGoodsAlbumFacade;
import com.leyu.mall.dao.goods.GoodsAlbumMapper;
import com.leyu.mall.domain.goods.GoodsAlbum;
import com.leyu.mall.service.goods.IGoodsAlbumService;

@Service
@Transactional(rollbackFor = Exception.class)
public class GoodsAlbumServiceImpl implements IGoodsAlbumService,IGoodsAlbumFacade {

	@Resource(name = "goodsAlbumMapper")
	private GoodsAlbumMapper goodsAlbumMapper;

	public GoodsAlbum getGoodsAlbumById(Long entity_id) throws Exception {
		return goodsAlbumMapper.getGoodsAlbumById(entity_id);
	}

	public void save(GoodsAlbum entity) throws Exception {
		if (entity.getAlbumId() == null) {
			goodsAlbumMapper.addGoodsAlbum(entity);

		} else {

			goodsAlbumMapper.updateByPrimaryKey(entity);
		}
	}
	public void deleteGoodsAlbum(Long id) throws Exception {
		goodsAlbumMapper.deleteGoodsAlbum(id);
	}
	public List<GoodsAlbum> getAllGoodsAlbum() throws Exception {
		return goodsAlbumMapper.getAllGoodsAlbum();

	}
	
 
	
}